<!DOCTYPE html>

<html>
<head>
<title>Test Document</title>
<style>
h2,
h3,
h4,
h5,
h6 {
  page-break-before: always;
  page-break-after: avoid;
}

a.toc_section::before {
  background: #fbc847;
  display: block;
  content: '';
  height: .08cm;
  margin-bottom: .25cm;
  width: 100%;
}

a.toc_section {
  font-weight: 500;
  margin: 3em 0 1em;
}

#contents {
    break-before: right;
    break-after: left;
    page: no-chapter;
}

#contents h2 {
    font-size: 20pt;
    font-weight: 400;
    margin-bottom: 3cm;
}

#contents a {
    font-weight: 500;
    display: block;  /* 使a表现得像块元素 */
    margin: 1em 0;  /* 添加间距 */
}

#contents ul {
    list-style: none;
    padding-left: 0;
}

#contents ul li {
    border-top: .25pt solid #c1c1c1;
    margin: .25cm 0;
    padding-top: .25cm;
}

#contents ul li a::before {
    color: #fbc847;
    content: '• ';
    font-size: 40pt;
    line-height: 16pt;
    vertical-align: bottom;
}

#contents ul li a {
    color: inherit;
    text-decoration-line: inherit;
}

#contents ul li a::after {
    color: #fbc847;
    content: target-counter(attr(href), page);
    float: right;
}
</style><style>
    @page {
        margin: 4cm;
        @bottom-right {
            background: #fbc847;
            content: counter(page);
            height: 1cm;
            text-align: center;
            width: 1cm;
        }
        @top-center {
            background: #fbc847;
            content: '';
            display: block;
            height: .05cm;
            opacity: .5;
            width: 100%;
        }
        @top-right {
            content: string(chapter);
            font-size: 9pt;
            height: 1cm;
            vertical-align: middle;
            width: 100%;
        }
    }

    html {
        color: #393939;
        font-family: Fira Sans;
        font-size: 11pt;
        font-weight: 300;
        line-height: 1.5;
    }

    .cover {
        page: cover;
    }

    @page cover {
        @bottom-center {
            content: none;
        }
    }

    /* 修改mermaid图片样式 */
    .mermaid {
        max-width: 100%;
        break-inside: avoid;
        width: auto;
        height: auto;
        image-rendering: high-quality;  /* 添加图片渲染质量设置 */
        -webkit-image-rendering: high-quality;
        -ms-image-rendering: high-quality;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        string-set: chapter content();
    }

    @media print {
        table {
            page-break-after: auto
        }

        tr {
            page-break-inside: avoid;
            page-break-after: auto
        }

        td {
            page-break-inside: avoid;
            page-break-after: auto
        }

        thead {
            display: table-header-group
        }

        tfoot {
            display: table-footer-group
        }
    }
    </style></head>
<body>
<div id="content"><div class="cover"><h1 class="cover-title">cpp学习笔记</h1><div class="cover-info"><p class="cover-info-text">作者：hemin0721 | 生成时间：2025-02-08 14:37:34 | 总字数：288 字</p></div></div><article id="contents"><h2>目录</h2><a class="toc_section" href="#section1">1 Section 1</a><ul><li><a href="#section1-1">1.1 Section 1.1</a></li><li><a href="#section1-1-1">1.1.1 Section 1.1.1</a></li><li><a href="#section1-2">1.2 Section 1.2</a></li></ul><a class="toc_section" href="#section2">2 Section 2</a><ul><li><a href="#section2-1">2.1 Section 2.1</a></li></ul></article>
<h1 id="section1">Section 1</h1>
<p>Content for section 1</p>
<h2 id="section1-1">Section 1.1</h2>
<p>Content for section 1.1</p>
<h3 id="section1-1-1">Section 1.1.1</h3>
<p>Content for section 1.1.1</p>
<h2 id="section1-2">Section 1.2</h2>
<p>Content for section 1.2</p>
<h1 id="section2">Section 2</h1>
<p>Content for section 2</p>
<h2 id="section2-1">Section 2.1</h2>
<p>Content for section 2.1</p>
</div>
</body>
</html>
